package com.cat.at.chat.domain;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class SparkResponseDTO implements Serializable {

    private Header header;

    private Payload payload;

    @Data
    public static class Header {
        private int code;
        private String message;
        private String sid;
        private int status;
    }

    @Data
    public static class Payload {
        private Choices choices;
        private Usage usage;
    }


    @Data
    public static class Choices {
        private int status;
        private int seq;
        private List<ChoicesText> text;
    }

    @Data
    public static class ChoicesText {
        private String content;
        private String role;
        private int index;
    }


    @Data
    public static class Usage {
        private UsageText text;
    }

    @Data
    public static class UsageText {
        @JSONField(name = "question_tokens")
        private int questionTokens;
        @JSONField(name = "prompt_tokens")
        private int promptTokens;
        @JSONField(name = "completion_tokens")
        private int completionTokens;
        @JSONField(name = "total_tokens")
        private int totalTokens;
    }


}
